package org.springframework.samples.petclinic.validation

import org.springframework.samples.petclinic.Visit
import org.springframework.util.StringUtils
import org.springframework.validation.Errors

class VisitValidator {

  def validate(visit:Visit, errors:Errors) = {
    if (!StringUtils.hasLength(visit.description)) {
      errors.rejectValue("description", "required", "required");
    }
  }

}
